<div ng-controller="companyListController">

    <div id="toolbar" class="selece_tj" style="float: right; margin: 20px 28px 20px 0px; cursor: pointer">
        <!--<button id="btn_add" type="button" class="btn btn-default" data-toggle="modal" data-target="#operateCompany" ng-click="addCompanyDialog()">-->
            <!--<span class="glyphicon glyphicon-plus" aria-hidden="true" ></span>新 增-->
        <!--</button>-->
        <a id="btn_add" class="unit-btnSelect" style="font-size: 14px;"
           data-toggle="modal"  aria-hidden="true" data-target="#operateCompany" ng-click="addCompanyDialog()">新 增</a>
    </div>
    <div class="query_table companyTable">
        <table class="table table-bordered table-striped">
            <tr>
                <td>公司名称</td>
                <td>公司地址</td>
                <td style="display: none !important;">公司邮箱</td>
                <td style="display: none !important;">客服号码</td>
                <td>管理员姓名</td>
                <td>管理员手机</td>
                <td>管理员账号</td>
                <td>公司URL</td>
                <td style="display: none !important;">登陆密码</td>
                <td style="display: none !important;">管理员职位</td>
                <td>操作</td>
            </tr>
            <tr ng-repeat="company in allCompany" class="click">
                <td ng-bind="company.name"></td>
                <td ng-bind="company.address"></td>
                <td ng-bind="company.email" style="display: none !important;"></td>
                <td ng-bind="company.telephone" style="display: none !important;"></td>
                <td ng-bind="company.manager.userName"></td>
                <td ng-bind="company.manager.mobile"></td>
                <td ng-bind="company.manager.name"></td>
                <td style=" position:relative; overflow: hidden;white-space: nowrap; text-overflow: ellipsis;">
                    <input type="text" ng-model="company.login" style="max-width: 80%; border-left:0px;border-top:0px;border-right:0px;border-bottom:1px">
                </td>
                <td ng-bind="company.manager.password" style="display: none !important;"></td>
                <td ng-bind="company.manager.job" style="display: none !important;"></td>
                <td>
                    <a href="javascript:void(0)" data-toggle="modal" data-target="#updateCompany"
                       data-backdrop="static" ng-click="UpdateCurrentCompany(company)">修改</a>
                </td>
            </tr>
        </table>

    </div>

    <!-- Modal addUser-->
    <div id="operateCompany" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h4 id="addUserLabel">新增企业</h4>
        </div>
        <div class="modal-body">
            <div class="container" style="width:600px; padding-bottom:20px">
                <div class="add-user-model1 InputPrompt">
                    <p>
                        <span>背景图：</span><input id="addCompanyToUpload" name="file" type="file"/><i>（非必填）</i>
                    <div class="col-md-12">
                        <img id="addCompanyPhotoNew" src=""
                             style="max-width:200px;max-height:200px;margin:0 auto;display:block;"/>
                    </div>
                    </p>
                    <p>
                        <span>企业名称：</span><input type="text"  placeholder="必填" id="CompanyName"/>
                        <span>企业地址：</span><input type="text"  placeholder="必填" id="CompanyAddress"/>
                    </p>
                    <p>
                        <span>企业邮箱：</span> <input type="text"  placeholder="必填" id="CompanyEmail"/>
                        <span>客服电话：</span> <input type="text"  placeholder="非必填" id="CompanyMobile"/>
                    </p>
                    <p>
                        <span>管理员账号：</span> <input type="text"  placeholder="必填" id="AdminAccount"/>
                        <span>管理员姓名：</span> <input type="text"  placeholder="必填" id="AdminName"/>
                    </p>
                    <p>
                        <span>企业坐标：</span> <input type="text"  placeholder="必填" id="CompanyCoordinate"/>
                        <button style="display: inline-block; margin-top: -5px;height: 28px; width: 50px; text-align: center
                        "><a style="color: #000;" href="mapAddress.html" target="_Blank">查询</a></button>
                    </p>

                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">关 闭</button>
            <button class="btn btn-primary"  ng-click="addCompany()">保 存</button>
        </div>
    </div>

    <!-- Modal updateUser-->
    <div id="updateCompany" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="updateUserLabel"
         aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h4 id="updateUserLabel">修改企业</h4>
        </div>
        <div class="modal-body">
            <div class="container" style="width:600px; padding-bottom:20px">
                <div class="add-user-model">
                    <p>
                        <span>背景图：</span><input id="updateCompanyToUpload" name="file" type="file"/>
                    <div class="col-md-12">
                        <img id="updateCompanyPhotoNew" src=""
                             style="max-width:200px;max-height:200px;margin:0 auto;display:block;"/>
                    </div>
                    </p>
                    <p>
                        <span>公司名称：</span><input type="text" ng-model="currentCompany.name" placeholder="必填" />
                        <span>公司地址：</span><input type="text" ng-model="currentCompany.address"  placeholder="必填" />
                    </p>
                    <p>
                        <span>企业邮箱：</span> <input type="text" ng-model="currentCompany.email" placeholder="必填" />
                        <span>客服电话：</span> <input type="text" ng-model="currentCompany.telephone"  placeholder="非必填" />
                    </p>
                    <p>
                        <span>管理员账号：</span> <input type="text" ng-model="currentCompany.manager.name" disabled/>
                        <span>管理员姓名：</span> <input type="text" ng-model="currentCompany.manager.userName" placeholder="必填" />
                    </p>
                    <p>
                        <span>企业坐标：</span> <input type="text" ng-model="currentCompany.location" id="up_CompanyCoordinate"/>
                        <button style="display: inline-block; margin-top: -5px;height: 28px; width: 50px; text-align: center
                        "><a style="color: #000;" href="mapAddress.html" target="_Blank">查询</a></button>
                    </p>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">关 闭</button>
            <button class="btn btn-primary"  ng-click="updateCompany()">保 存</button>
        </div>
    </div>

</div>
